package com.assignwork.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;

import java.math.BigDecimal;

/**
 * @ClassName WaShipCabinInfo
 * @Description 舱信息
 * @Author dujianyu
 * @Date 2023/12/22 14:40
 */
@Data
public class WaShipCabinInfo {

    @ApiModelProperty(value = "实际舱1")
    private String realCabin1;

    @ApiModelProperty(value = "实际位置1")
    private String realHatch1;

    @ApiModelProperty(value = "实际舱2")
    private String realCabin2;

    @ApiModelProperty(value = "实际位置2")
    private String realHatch2;

    @ApiModelProperty(value = "所有计划位置")
    private String allPlanCabins;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "辅助队组")
    private Long supportMachineCorp;

    @ApiModelProperty(value = "辅助队组")
    private String supportMachineCorpName;

    @ApiModelProperty(value = "辅助机械")
    private String supportMachineKind;

    @ApiModelProperty(value = "辅助机械")
    private String supportMachineKindName;

    @ApiModelProperty(value = "下舱机械")
    private String underMachines;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "作业量")
    private BigDecimal planTon;

    @ApiModelProperty(value = "船机数量")
    private Integer shipMachineryCount;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "固机")
    private Long fixedMachineId;

    @ApiModelProperty(value = "固机")
    private String fixedMachineName;

    private String fixedMachinePosition;

    private String fixedMachinePositionName;

    public String getFixedMachineName() {
        if (Func.isNotBlank(fixedMachineName)) {
            return fixedMachinePositionName + "门吊_" + fixedMachineName;
        }

        return fixedMachineName;
    }

}
